package com.example.controller;

import com.example.clients.HelloClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RestController
public class HelloController {

    @Autowired
    HelloClient helloClient;

    @GetMapping("/test")
    public String hello(){
        return helloClient.hello();
    }

    @Value("${testValue}")
    Object testValue;

    @GetMapping("/test1")
    public Object test1(){
        return testValue;
    }

}
